home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / FindReplace.java < prev    next >
Text File  |  1997-08-27  |  2KB  |  65 lines

  1. import java.lang.*;
  2. import java.awt.*;
  3.  
  4. class FindReplace extends java.lang.Object
  5. {
  6.     
  7.     public FindReplace(String findthis, TextComponent tc)
  8.     {
  9.         this(findthis,"",tc);
  10.     }
  11.         
  12.     public FindReplace(String findthis, String replacethis, TextComponent thebody)
  13.     {
  14.         setFind(findthis);
  15.         setReplace(replacethis);
  16.         setBody(thebody);
  17.     }
  18.     
  19.     String m_findme;
  20.     String m_replace;
  21.     boolean m_matchCase;
  22.     boolean m_selectedArea;
  23.     boolean m_replaceAll;
  24.     boolean m_cancel;
  25.     boolean m_foundIt;
  26.     boolean m_replaceIt;
  27.     int m_numoccur = 0;
  28.     int m_current_index = 0;
  29.     java.awt.TextComponent m_body;
  30.       
  31.     public void setReplaceIt(boolean replace) { m_replaceIt = replace; }
  32.     public boolean isReplaceIt() { return m_replaceIt; }
  33.     
  34.     public void setBody(TextComponent body) { m_body = body; }
  35.     public TextComponent getBody() { return m_body; }
  36.       
  37.     public void setFind(String findthis) { m_findme = findthis;}
  38.     public String getFind() { return m_findme; }
  39.     
  40.     public void setReplace(String replacethis) { m_replace = replacethis; }
  41.     public String getReplace() { return m_replace; }
  42.  
  43.     public void setIndex(int index) { m_current_index = index; }
  44.     public int getIndex() { return m_current_index; }
  45.  
  46.     public void setFoundIt(boolean foundit) { m_foundIt = foundit; }
  47.     public boolean isFoundIt() { return m_foundIt; }
  48.     
  49.     public void setOccur(int numtimes) { m_numoccur = numtimes; }  
  50.     public int getOccur() { return m_numoccur; }
  51.     public void incOccur() { m_numoccur++; }
  52.  
  53.     public void setCase(boolean matchcase) { m_matchCase = matchcase; }
  54.     public boolean isCase() { return m_matchCase; }
  55.     
  56.     public void setSelectArea(boolean select) { m_selectedArea = select; }
  57.     public boolean isSelectArea() { return m_selectedArea; }
  58.     
  59.     public void setReplaceAll(boolean replaceall) { m_replaceAll = replaceall; }
  60.     public boolean isReplaceAll() { return m_replaceAll; }
  61.  
  62.     public void setCancel(boolean cancel) { m_cancel = cancel; }
  63.     public boolean isCancel() { return m_cancel; }
  64.  
  65. }